<template>
  <div
    class="reference-block"
    :style="{background:iconType==1 ? '' : activeColor}"
  >
    <el-image v-if="iconType==1" class="img" :src="accurateUrl" />
    <svg-icon v-else :icon-class="appIcon" class-name="icon-bg" />
  </div>
</template>

<script>
export default {
  props: {
    iconType: {
      type: [String, Number],
      default: ''
    },
    appIcon: {
      type: String,
      default: ''
    },
    activeColor: {
      type: String,
      default: ''
    }
  },
  data() {
    return {}
  },
  computed: {
    accurateUrl() {
      return this.iconType == 1 ? (process.env.VUE_APP_BASE_API + this.appIcon) : ''
    }
  },
  methods: {}
}
</script>

<style lang="scss" scoped>
.reference-block{
    width: 40px;
    height: 40px;
    border-radius: 7px;
    line-height: 48px;
    text-align: center;
    .img{
      width: 100%;
      height: 100%;
      border-radius: 7px;
    }
    .icon-bg{
       font-size: 30px;
     }
}
</style>
